<?php
		
	/* SVN FILE: $Id: uploads.info.php 8 2011-03-13 08:32:38Z michele.andreoletti@gmail.com $ */
	
	/**
	* Project Name : arcadia
	*
	* @author $Author: michele.andreoletti@gmail.com $
	* @version $Revision: 8 $
	* @lastrevision $Date: 2011-03-13 08:32:38 +0000 (Sun, 13 Mar 2011) $
	* @filesource $URL: http://arcadia.googlecode.com/svn/trunk/include/uploads.info.php $
	*/
			
	date_default_timezone_set('Europe/Rome');

	if(isset($_GET['sAPP']) && !empty($_GET['sAPP'])) {
		$sAPP = $_GET['sAPP'];	
	
	} else {
		require_once "./const.inc.php";
		require_once "./functions.php";
		// require_once "./auth.inc.php";
		require_once "./conn.inc.php";
		
		fnUpdateLog('APP NOT DEFINED', 0, '', 'E');
		echo fnJsonOutput(fnCurrentScript(), '', '', 888);
		die();
	
	}

	require_once "../$sAPP/include/const.inc.php";
	require_once "../$sAPP/include/functions.php";
	require_once "./auth.inc.php";
	require_once "./conn.inc.php";

	fnGetValueFromGET(array('iView','sViewItemLink','sAPP'));
	
	fnViewConst($sViewItemLink);
		
	$sScript = fnCurrentScript();
	
	$iAccessLvl = fnGetAccessLvl();
	$iFieldAccessLvl = fnFieldAccessLvl($iAccessLvl, $sViewItemLink, $iTabUploads);
	
	if (is_allowed('view', $iFieldAccessLvl)) {
		$html = fnUploadsFileList('sHtml', $iView, $iTabUploads, $sViewItemLink);	
		$iUploadsNum = fnUploadsFileList('iUploadsNum', $iView, $iTabUploads, $sViewItemLink);	
		$sError = '';
	
	} else  {
		$html .= "	<ul><li>Autorizzazione insufficiente per visualizzare gli allegati</li></ul>";
		$iUploadsNum = 0;
		$sError = 'Low rights';
		fnUpdateLog("LOW RIGHTS", $iView, $sViewSelectFrom, 'S');
	
	}	
	
	$sOutput = fnJsonOutput($sScript, '', $html, 0, array('iUploadsNum' => $iUploadsNum));

	echo $sOutput;
	die();
	
?>